Support Linstor Primary Storage for NAS BnR#12796
Support Linstor Primary Storage for NAS BnR#12796abh1sar wants to merge 5 commits intoapache:4.22from
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12796 +/- ##
============================================
- Coverage 17.60% 17.60% -0.01%
Complexity 15677 15677
============================================
Files 5918 5918
Lines 531681 531727 +46
Branches 65005 65016 +11
============================================
- Hits 93623 93620 -3
- Misses 427498 427545 +47
- Partials 10560 10562 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| volumePathPrefix = storagePool.getPath(); | ||
| volumePathPrefix = storagePool.getPath() + "/"; | ||
| } else if (Storage.StoragePoolType.Linstor.equals(storagePool.getPoolType())) { | ||
| volumePathPrefix = "/dev/drbd/by-res/cs-"; |
There was a problem hiding this comment.
can keep this path in LinstorUtil, and use it here
There was a problem hiding this comment.
Can't access LinstorUtil from here.
|
Hi @rp- Can you perform some tests with this PR changes and confirm? |
.../main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java
Outdated
Show resolved
Hide resolved
.../main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java
Outdated
Show resolved
Hide resolved
|
@blueorangutan package |
|
@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17143 |
I created a test cluster and also tested the backup nfs. Or would it be possible to later use Maybe also @sbrueseke wants to check this out |
|
As far as I understand the backup framework, it uses virsh for running instances and qemu-img for stopped instances. Is this correct? So for stopped instances adding a -c parameter would be easy and would make sense to me. But virsh does not have a parameter for compression, at least not that I am aware of. |
@sbrueseke 😆 Thank you for thinking, but I actually just wanted to make you aware of this PR and maybe you want to test it. |
Co-authored-by: Abhisar Sinha <63767682+abh1sar@users.noreply.github.com>
|
@blueorangutan package |
|
@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17360 |
|
@blueorangutan test |
|
@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15811)
|
rp-
left a comment
There was a problem hiding this comment.
Except for the large backup .qcow2 I have no further objections.
I did some testing and found out that There is no other way to avoid this with virsh backup-begin, so our best bet is to release the storage space after backup file is created. @rp- would you be able to verify the fix so that we can merge this in 4.22.1 before the freeze this Friday? Thanks. |
|
@blueorangutan package |
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #12218 by aligning NAS backup/restore behavior with how Linstor-backed volumes are identified and addressed on KVM hosts, enabling successful restore / create-from-backup workflows when the target primary storage is Linstor.
Changes:
- Update KVM NAS backup script to name backup qcow2 files using the Linstor volume UUID (derived from
/dev/drbd/by-res/cs-<uuid>/0) and add a post-backup sparsification step for Linstor-backed disks. - Extend KVM restore wrapper logic to correctly derive volume UUIDs for Linstor paths, restore to Linstor block devices, and attach Linstor volumes as RAW disks.
- Add
restoreVolumeSizestoRestoreBackupCommandand plumb it through NAS restore flows (with test updates to satisfy the new command shape).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/vm/hypervisor/kvm/nasbackup.sh | Adjusts backup naming for Linstor block devices and adds a Linstor qcow2 re-sparsification step. |
| plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java | Builds correct restore paths for Linstor (/dev/drbd/by-res/cs-<id>/0) and sends restore volume sizes. |
| core/src/main/java/org/apache/cloudstack/backup/RestoreBackupCommand.java | Adds restoreVolumeSizes field to carry target volume sizing info to the agent. |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java | Adds Linstor-aware UUID extraction, block-device restore handling, and RAW attach for Linstor. |
| plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapperTest.java | Updates mocks for new command fields/pool type requirements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.../main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java
Outdated
Show resolved
Hide resolved
plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java
Outdated
Show resolved
Hide resolved
.../main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java
Show resolved
Hide resolved
|
@blueorangutan package |
|
@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17385 |
Just tested it now and looks good. |
Description
This PR fixes #12218
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Validated Data after Restore.
How did you try to break this feature and the system with this change?